3.348 \(\int \frac {\log ^2(c (a+b x)^n)}{d+e x+f x^2} \, dx\)

Optimal. Leaf size=372 \[ \frac {2 n \log \left (c (a+b x)^n\right ) \text {Li}_2\left (\frac {2 f (a+b x)}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {2 n \log \left (c (a+b x)^n\right ) \text {Li}_2\left (\frac {2 f (a+b x)}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}+\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (-\sqrt {e^2-4 d f}+e+2 f x\right )}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (\sqrt {e^2-4 d f}+e+2 f x\right )}{2 a f-b \left (\sqrt {e^2-4 d f}+e\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {2 n^2 \text {Li}_3\left (\frac {2 f (a+b x)}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}+\frac {2 n^2 \text {Li}_3\left (\frac {2 f (a+b x)}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}} \]

[Out]

ln(c*(b*x+a)^n)^2*ln(-b*(e+2*f*x-(-4*d*f+e^2)^(1/2))/(2*a*f-b*(e-(-4*d*f+e^2)^(1/2))))/(-4*d*f+e^2)^(1/2)-ln(c
*(b*x+a)^n)^2*ln(-b*(e+2*f*x+(-4*d*f+e^2)^(1/2))/(2*a*f-b*(e+(-4*d*f+e^2)^(1/2))))/(-4*d*f+e^2)^(1/2)+2*n*ln(c
*(b*x+a)^n)*polylog(2,2*f*(b*x+a)/(2*a*f-b*(e-(-4*d*f+e^2)^(1/2))))/(-4*d*f+e^2)^(1/2)-2*n*ln(c*(b*x+a)^n)*pol
ylog(2,2*f*(b*x+a)/(2*a*f-b*(e+(-4*d*f+e^2)^(1/2))))/(-4*d*f+e^2)^(1/2)-2*n^2*polylog(3,2*f*(b*x+a)/(2*a*f-b*(
e-(-4*d*f+e^2)^(1/2))))/(-4*d*f+e^2)^(1/2)+2*n^2*polylog(3,2*f*(b*x+a)/(2*a*f-b*(e+(-4*d*f+e^2)^(1/2))))/(-4*d
*f+e^2)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.41, antiderivative size = 372, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 5, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2418, 2396, 2433, 2374, 6589} \[ \frac {2 n \log \left (c (a+b x)^n\right ) \text {PolyLog}\left (2,\frac {2 f (a+b x)}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {2 n \log \left (c (a+b x)^n\right ) \text {PolyLog}\left (2,\frac {2 f (a+b x)}{2 a f-b \left (\sqrt {e^2-4 d f}+e\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {2 n^2 \text {PolyLog}\left (3,\frac {2 f (a+b x)}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}+\frac {2 n^2 \text {PolyLog}\left (3,\frac {2 f (a+b x)}{2 a f-b \left (\sqrt {e^2-4 d f}+e\right )}\right )}{\sqrt {e^2-4 d f}}+\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (-\sqrt {e^2-4 d f}+e+2 f x\right )}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (\sqrt {e^2-4 d f}+e+2 f x\right )}{2 a f-b \left (\sqrt {e^2-4 d f}+e\right )}\right )}{\sqrt {e^2-4 d f}} \]

Antiderivative was successfully verified.

[In]

Int[Log[c*(a + b*x)^n]^2/(d + e*x + f*x^2),x]

[Out]

(Log[c*(a + b*x)^n]^2*Log[-((b*(e - Sqrt[e^2 - 4*d*f] + 2*f*x))/(2*a*f - b*(e - Sqrt[e^2 - 4*d*f])))])/Sqrt[e^
2 - 4*d*f] - (Log[c*(a + b*x)^n]^2*Log[-((b*(e + Sqrt[e^2 - 4*d*f] + 2*f*x))/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f]
)))])/Sqrt[e^2 - 4*d*f] + (2*n*Log[c*(a + b*x)^n]*PolyLog[2, (2*f*(a + b*x))/(2*a*f - b*(e - Sqrt[e^2 - 4*d*f]
))])/Sqrt[e^2 - 4*d*f] - (2*n*Log[c*(a + b*x)^n]*PolyLog[2, (2*f*(a + b*x))/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f])
)])/Sqrt[e^2 - 4*d*f] - (2*n^2*PolyLog[3, (2*f*(a + b*x))/(2*a*f - b*(e - Sqrt[e^2 - 4*d*f]))])/Sqrt[e^2 - 4*d
*f] + (2*n^2*PolyLog[3, (2*f*(a + b*x))/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f]))])/Sqrt[e^2 - 4*d*f]

Rule 2374

Int[(Log[(d_.)*((e_) + (f_.)*(x_)^(m_.))]*((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.))/(x_), x_Symbol] :> -Sim
p[(PolyLog[2, -(d*f*x^m)]*(a + b*Log[c*x^n])^p)/m, x] + Dist[(b*n*p)/m, Int[(PolyLog[2, -(d*f*x^m)]*(a + b*Log
[c*x^n])^(p - 1))/x, x], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IGtQ[p, 0] && EqQ[d*e, 1]

Rule 2396

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_)/((f_.) + (g_.)*(x_)), x_Symbol] :> Simp[(Log[(e*
(f + g*x))/(e*f - d*g)]*(a + b*Log[c*(d + e*x)^n])^p)/g, x] - Dist[(b*e*n*p)/g, Int[(Log[(e*(f + g*x))/(e*f -
d*g)]*(a + b*Log[c*(d + e*x)^n])^(p - 1))/(d + e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && NeQ[e*
f - d*g, 0] && IGtQ[p, 1]

Rule 2418

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[
(a + b*Log[c*(d + e*x)^n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, n}, x] && RationalFunct
ionQ[RFx, x] && IntegerQ[p]

Rule 2433

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + Log[(h_.)*((i_.) + (j_.)*(x_))^(m_.)]*
(g_.))*((k_.) + (l_.)*(x_))^(r_.), x_Symbol] :> Dist[1/e, Subst[Int[((k*x)/d)^r*(a + b*Log[c*x^n])^p*(f + g*Lo
g[h*((e*i - d*j)/e + (j*x)/e)^m]), x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, j, k, l, n, p, r},
 x] && EqQ[e*k - d*l, 0]

Rule 6589

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rubi steps

\begin {align*} \int \frac {\log ^2\left (c (a+b x)^n\right )}{d+e x+f x^2} \, dx &=\int \left (\frac {2 f \log ^2\left (c (a+b x)^n\right )}{\sqrt {e^2-4 d f} \left (e-\sqrt {e^2-4 d f}+2 f x\right )}-\frac {2 f \log ^2\left (c (a+b x)^n\right )}{\sqrt {e^2-4 d f} \left (e+\sqrt {e^2-4 d f}+2 f x\right )}\right ) \, dx\\ &=\frac {(2 f) \int \frac {\log ^2\left (c (a+b x)^n\right )}{e-\sqrt {e^2-4 d f}+2 f x} \, dx}{\sqrt {e^2-4 d f}}-\frac {(2 f) \int \frac {\log ^2\left (c (a+b x)^n\right )}{e+\sqrt {e^2-4 d f}+2 f x} \, dx}{\sqrt {e^2-4 d f}}\\ &=\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e-\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e+\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {(2 b n) \int \frac {\log \left (c (a+b x)^n\right ) \log \left (\frac {b \left (e-\sqrt {e^2-4 d f}+2 f x\right )}{-2 a f+b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{a+b x} \, dx}{\sqrt {e^2-4 d f}}+\frac {(2 b n) \int \frac {\log \left (c (a+b x)^n\right ) \log \left (\frac {b \left (e+\sqrt {e^2-4 d f}+2 f x\right )}{-2 a f+b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{a+b x} \, dx}{\sqrt {e^2-4 d f}}\\ &=\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e-\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e+\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {(2 n) \operatorname {Subst}\left (\int \frac {\log \left (c x^n\right ) \log \left (\frac {b \left (\frac {-2 a f+b \left (e-\sqrt {e^2-4 d f}\right )}{b}+\frac {2 f x}{b}\right )}{-2 a f+b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt {e^2-4 d f}}+\frac {(2 n) \operatorname {Subst}\left (\int \frac {\log \left (c x^n\right ) \log \left (\frac {b \left (\frac {-2 a f+b \left (e+\sqrt {e^2-4 d f}\right )}{b}+\frac {2 f x}{b}\right )}{-2 a f+b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt {e^2-4 d f}}\\ &=\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e-\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e+\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}+\frac {2 n \log \left (c (a+b x)^n\right ) \text {Li}_2\left (\frac {2 f (a+b x)}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {2 n \log \left (c (a+b x)^n\right ) \text {Li}_2\left (\frac {2 f (a+b x)}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {\left (2 n^2\right ) \operatorname {Subst}\left (\int \frac {\text {Li}_2\left (-\frac {2 f x}{-2 a f+b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt {e^2-4 d f}}+\frac {\left (2 n^2\right ) \operatorname {Subst}\left (\int \frac {\text {Li}_2\left (-\frac {2 f x}{-2 a f+b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt {e^2-4 d f}}\\ &=\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e-\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e+\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}+\frac {2 n \log \left (c (a+b x)^n\right ) \text {Li}_2\left (\frac {2 f (a+b x)}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {2 n \log \left (c (a+b x)^n\right ) \text {Li}_2\left (\frac {2 f (a+b x)}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {2 n^2 \text {Li}_3\left (\frac {2 f (a+b x)}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}+\frac {2 n^2 \text {Li}_3\left (\frac {2 f (a+b x)}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.45, size = 655, normalized size = 1.76 \[ \frac {2 n \sqrt {4 d f-e^2} \log \left (c (a+b x)^n\right ) \text {Li}_2\left (\frac {2 f (a+b x)}{2 a f+b \left (\sqrt {e^2-4 d f}-e\right )}\right )-2 n \sqrt {4 d f-e^2} \log \left (c (a+b x)^n\right ) \text {Li}_2\left (\frac {2 f (a+b x)}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )+2 n \sqrt {4 d f-e^2} \log (a+b x) \log \left (c (a+b x)^n\right ) \log \left (1-\frac {2 f (a+b x)}{2 a f+b \sqrt {e^2-4 d f}+b (-e)}\right )-2 n \sqrt {4 d f-e^2} \log (a+b x) \log \left (c (a+b x)^n\right ) \log \left (\frac {2 f (a+b x)}{b \left (\sqrt {e^2-4 d f}+e\right )-2 a f}+1\right )+2 \sqrt {e^2-4 d f} \tan ^{-1}\left (\frac {e+2 f x}{\sqrt {4 d f-e^2}}\right ) \log ^2\left (c (a+b x)^n\right )-4 n \sqrt {e^2-4 d f} \log (a+b x) \tan ^{-1}\left (\frac {e+2 f x}{\sqrt {4 d f-e^2}}\right ) \log \left (c (a+b x)^n\right )-2 n^2 \sqrt {4 d f-e^2} \text {Li}_3\left (\frac {2 f (a+b x)}{-e b+\sqrt {e^2-4 d f} b+2 a f}\right )+2 n^2 \sqrt {4 d f-e^2} \text {Li}_3\left (\frac {2 f (a+b x)}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )-n^2 \sqrt {4 d f-e^2} \log ^2(a+b x) \log \left (1-\frac {2 f (a+b x)}{2 a f+b \sqrt {e^2-4 d f}+b (-e)}\right )+n^2 \sqrt {4 d f-e^2} \log ^2(a+b x) \log \left (\frac {2 f (a+b x)}{b \left (\sqrt {e^2-4 d f}+e\right )-2 a f}+1\right )+2 n^2 \sqrt {e^2-4 d f} \log ^2(a+b x) \tan ^{-1}\left (\frac {e+2 f x}{\sqrt {4 d f-e^2}}\right )}{\sqrt {-\left (e^2-4 d f\right )^2}} \]

Antiderivative was successfully verified.

[In]

Integrate[Log[c*(a + b*x)^n]^2/(d + e*x + f*x^2),x]

[Out]

(2*Sqrt[e^2 - 4*d*f]*n^2*ArcTan[(e + 2*f*x)/Sqrt[-e^2 + 4*d*f]]*Log[a + b*x]^2 - 4*Sqrt[e^2 - 4*d*f]*n*ArcTan[
(e + 2*f*x)/Sqrt[-e^2 + 4*d*f]]*Log[a + b*x]*Log[c*(a + b*x)^n] + 2*Sqrt[e^2 - 4*d*f]*ArcTan[(e + 2*f*x)/Sqrt[
-e^2 + 4*d*f]]*Log[c*(a + b*x)^n]^2 - Sqrt[-e^2 + 4*d*f]*n^2*Log[a + b*x]^2*Log[1 - (2*f*(a + b*x))/(-(b*e) +
2*a*f + b*Sqrt[e^2 - 4*d*f])] + 2*Sqrt[-e^2 + 4*d*f]*n*Log[a + b*x]*Log[c*(a + b*x)^n]*Log[1 - (2*f*(a + b*x))
/(-(b*e) + 2*a*f + b*Sqrt[e^2 - 4*d*f])] + Sqrt[-e^2 + 4*d*f]*n^2*Log[a + b*x]^2*Log[1 + (2*f*(a + b*x))/(-2*a
*f + b*(e + Sqrt[e^2 - 4*d*f]))] - 2*Sqrt[-e^2 + 4*d*f]*n*Log[a + b*x]*Log[c*(a + b*x)^n]*Log[1 + (2*f*(a + b*
x))/(-2*a*f + b*(e + Sqrt[e^2 - 4*d*f]))] + 2*Sqrt[-e^2 + 4*d*f]*n*Log[c*(a + b*x)^n]*PolyLog[2, (2*f*(a + b*x
))/(2*a*f + b*(-e + Sqrt[e^2 - 4*d*f]))] - 2*Sqrt[-e^2 + 4*d*f]*n*Log[c*(a + b*x)^n]*PolyLog[2, (2*f*(a + b*x)
)/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f]))] - 2*Sqrt[-e^2 + 4*d*f]*n^2*PolyLog[3, (2*f*(a + b*x))/(-(b*e) + 2*a*f +
 b*Sqrt[e^2 - 4*d*f])] + 2*Sqrt[-e^2 + 4*d*f]*n^2*PolyLog[3, (2*f*(a + b*x))/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f]
))])/Sqrt[-(e^2 - 4*d*f)^2]

________________________________________________________________________________________

fricas [F]  time = 0.44, size = 0, normalized size = 0.00 \[ {\rm integral}\left (\frac {\log \left ({\left (b x + a\right )}^{n} c\right )^{2}}{f x^{2} + e x + d}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(c*(b*x+a)^n)^2/(f*x^2+e*x+d),x, algorithm="fricas")

[Out]

integral(log((b*x + a)^n*c)^2/(f*x^2 + e*x + d), x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\log \left ({\left (b x + a\right )}^{n} c\right )^{2}}{f x^{2} + e x + d}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(c*(b*x+a)^n)^2/(f*x^2+e*x+d),x, algorithm="giac")

[Out]

integrate(log((b*x + a)^n*c)^2/(f*x^2 + e*x + d), x)

________________________________________________________________________________________

maple [F]  time = 20.05, size = 0, normalized size = 0.00 \[ \int \frac {\ln \left (c \left (b x +a \right )^{n}\right )^{2}}{f \,x^{2}+e x +d}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(ln(c*(b*x+a)^n)^2/(f*x^2+e*x+d),x)

[Out]

int(ln(c*(b*x+a)^n)^2/(f*x^2+e*x+d),x)

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(c*(b*x+a)^n)^2/(f*x^2+e*x+d),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*d*f-e^2>0)', see `assume?` f
or more details)Is 4*d*f-e^2 positive or negative?

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.00 \[ \int \frac {{\ln \left (c\,{\left (a+b\,x\right )}^n\right )}^2}{f\,x^2+e\,x+d} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(log(c*(a + b*x)^n)^2/(d + e*x + f*x^2),x)

[Out]

int(log(c*(a + b*x)^n)^2/(d + e*x + f*x^2), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\log {\left (c \left (a + b x\right )^{n} \right )}^{2}}{d + e x + f x^{2}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(ln(c*(b*x+a)**n)**2/(f*x**2+e*x+d),x)

[Out]

Integral(log(c*(a + b*x)**n)**2/(d + e*x + f*x**2), x)

________________________________________________________________________________________